<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/3/30
  Time: 16:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <script src="/js/jquery-3.4.1.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
</head>
<body style="width: 80%;margin: auto">
<img src="${patha}">
<table class="table table-hover">
    <caption><a href="/newsUpdate">新增新闻</a></caption>
    <thead>
    <tr>
        <th>ID</th>
        <th>新闻标题</th>
        <th>新闻介绍</th>
        <th>新闻事件</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${list}" var="news">
        <tr>
            <td>${news.id}</td>
            <td>${news.title}</td>
            <td>${news.introduction}</td>
            <td>${news.create_time}</td>
            <td>
                <a href="newsUpdate?id=${news.id}"> 修改</a>
                <a href="newsUpdate?id=${news.id}"> 删除</a>
            </td>
        </tr>
    </c:forEach>


    </tbody>
</table>
<div>
    <%--    a标签默认get方法--%>
    总条数 ${map.get("count")}条&nbsp;&nbsp;
    共${map.get("countPage")}页&nbsp;&nbsp;

    <a href="/newsFindAll?type=1&dangqianye=${map.get('dangqianye')}">首页</a>
    <a href="/newsFindAll?type=2&dangqianye=${map.get('dangqianye')}">上一页</a>
    <a href="/newsFindAll?type=3&dangqianye=${map.get('dangqianye')}">下一页</a>
    <a href="/newsFindAll?type=4&dangqianye=${map.get('dangqianye')}">末页</a>
    <form action="/newsFindAll">
        每一页显示 <input type="text" name="pageSize" value="${map.get('pageSize')}"> 条
        跳转到<input type="text" name="dangqianye" value="${map.get('dangqianye')}">页
        <input type="submit" value="确定">
    </form>
</div>
</body>
</html>
